package cn.edu.gench.learn.day5;

import java.util.ArrayList;

/**
 * Created by Administrator on 2017/4/7.
 */
public class ArrayListTest {

    public static void main(String[] args) {
        ArrayList arrayList = new ArrayList();
        arrayList.add(1);
        arrayList.add(100);
        arrayList.add(76);
        arrayList.add(34);
        arrayList.add(90);
        arrayList.add(3,45);

        System.out.println("1:"+arrayList.get(1));
        System.out.println("2:"+arrayList.indexOf(100));
        for (Object obj:arrayList){
            System.out.println(":"+obj);
        }

        for(int i=0;i<arrayList.size();i++){
            System.out.println("x"+arrayList.get(i));
        }

    }

}
